# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-dogpile.cache
pkgver=1.2.2
pkgrel=1
pkgdesc="A caching front-end based on the Dogpile lock"
arch=('any')
url="https://pypi.python.org/pypi/dogpile.cache"
license=('BSD')
depends=('python-decorator' 'python-stevedore')
makedepends=('python-setuptools')
checkdepends=('memcached' 'pifpaf' 'redis' 'python-mako' 'python-redis' 'python-pytest'
              'python-pytest-cov' 'python-pylibmc')
source=("https://pypi.io/packages/source/d/dogpile.cache/dogpile.cache-$pkgver.tar.gz")
sha512sums=('23b078b79e4b1f87c8d397d35b772f0b5fee66a0e452de06e7644ecb1ef577ae1629307a0e32fa62f49d536f95fb62fe70ededeb43647fa0c2e0baf896261931')

build() {
  cd dogpile.cache-$pkgver
  python setup.py build
}

check() {
  cd dogpile.cache-$pkgver
  python -m pytest -k 'not test_memcached_backend and not test_redis_backend'
  pifpaf --env-prefix DOGPILE run memcached --port 11234 -- python -m pytest tests/cache/test_memcached_backend.py
  pifpaf --env-prefix DOGPILE run redis --port 11234 -- python -m pytest tests/cache/test_redis_backend.py
}

package() {
  cd dogpile.cache-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
